<template>
    <div class="new-user-index">
        <div class="profile-body">
            <div class="body-left">
                <div class="banner-wrap">
                    <a target="_blank" rel="noopener noreferrer">
                        <img class="banner" src="/img/personal_bg.jpg" alt="banner">
                    </a>
                </div>
                <div class="card">
                    <div class="user-info">
                        <div class="user-info-top">
                            <div class="avatar-wrap">
                                <a class="avatar-user">
                                    <img class="avatar-img" src="/img/avatar1.jpg" alt="墨鱼nokoya">
                                </a>
                            </div>
                            <div class="operations">
                                <div>
                                    <button class="follow-btn">关注 TA</button>
                                </div>
                                <button class="pm-btn">私信</button>
                                <div class="dm-popover">
                                    <span>
                                        <div class="more-btn">
                                            <svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"
                                                viewBox="0 0 28 28">
                                                <path fill="#575759" fill-rule="evenodd"
                                                    d="M7 16a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm7 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm7 0a2 2 0 1 1 0-4 2 2 0 0 1 0  4z">
                                                </path>
                                            </svg>
                                        </div>
                                    </span>
                                    <div class="dm-popover-content dm-popover-BL"
                                        style="width: 122px; height: 82px; padding: 0px; border: 1px solid rgb(233, 233, 240); top: 51px; right: 0px;">
                                        <span class="dm-popover-arrow arrow-B" style="top:-6px;right:10px"></span>
                                        <ul class="more-opts">
                                            <li class="opt-item clickable">举报</li>
                                            <li class="opt-item clickable">加入黑名单</li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="user-info-bottom">
                            <div class="user-info-name">墨鱼nokoya</div>
                            <div class="user-info-tags">
                                <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
                                    <g fill="none" fill-rule="evenodd">
                                        <rect width="20" height="20" fill="#F5F5FA" fill-rule="nonzero" rx="4"></rect>
                                        <path fill="#FB4E4E"
                                            d="M10.667 13.333H12a.666.666 0 1 1 0 1.334h-1.333v1.343a.666.666 0 1 1-1.334 0v-1.343H8a.666.666 0 1 1 0-1.334h1.333v-1.39a4 4 0 1 1 1.334 0v1.39zM10 10.667a2.666 2.666 0 1 0 0-5.333 2.666 2.666 0 0 0 0 5.333z">
                                        </path>
                                    </g>
                                </svg>
                                <span class="user-info-tag">绘师</span>
                                <span class="user-info-tag">学生党</span>
                                <span class="user-info-tag">番剧宅</span>
                                <span class="user-info-tag">其他 其他</span>
                            </div>
                            <div class="user-info-self-intro">这里墨鱼 请多指教w lofID：moyuyuw 暂不接稿</div>
                            <div class="user-info-follow">
                                <a class="follow-item underline">453<span class="thin-txt"> 关注</span></a>
                                <a class="follow-item underline">32311<span class="thin-txt"> 粉丝</span></a>
                                <span class="follow-item">198725<span class="thin-txt"> 获赞</span></span>
                            </div>
                        </div>
                    </div>
                    <ul class="nav-tab">
                        <li :class="'nav-item ' + (tabIndex === 1 ? 'active' : '')">
                            <div class="dm-popover">
                                <span>
                                    <a class="nav-txt">TA 的发布</a>
                                </span>
                                <div class="dm-popover-content dm-popover-Bottom"
                                    style="width: 100px; height: 202px; padding: 0px; border: 1px solid rgb(233, 233, 240); top: 39px; left: 50%; margin-left: -49px;">
                                    <span class="dm-popover-arrow arrow-B"
                                        style="top:-6px;left:50%;margin-left:-6px"></span>
                                    <ul class="filter-list">
                                        <li :class="'filter-item ' + (tabIndexOfSmall === 1 ? 'active' : '')"
                                            @click="selTab(1, 1)">全部</li>
                                        <li :class="'filter-item ' + (tabIndexOfSmall === 2 ? 'active' : '')"
                                            @click="selTab(1, 2)">图片</li>
                                        <li :class="'filter-item ' + (tabIndexOfSmall === 3 ? 'active' : '')"
                                            @click="selTab(1, 3)">文字</li>
                                        <li :class="'filter-item ' + (tabIndexOfSmall === 4 ? 'active' : '')"
                                            @click="selTab(1, 4)">问答</li>
                                        <li :class="'filter-item ' + (tabIndexOfSmall === 5 ? 'active' : '')"
                                            @click="selTab(1, 5)">视频</li>
                                    </ul>
                                </div>
                            </div>
                            <svg width="12px" height="12px" class="spread" viewBox="0 0 12 12">
                                <path fill-rule="evenodd"
                                    d="M10.0432258,4.64812908 L6.5377549,8.85469413 C6.29026004,9.15168795 5.84886475,9.1918148 5.55187092,8.94431994 C5.51934677,8.91721649 5.48934856,8.88721827 5.4622451,8.85469413 L1.95677423,4.64812908 C1.70927938,4.35113525 1.74940622,3.90973996 2.04640005,3.6622451 C2.17220055,3.55741135 2.33077358,3.5 2.49452913,3.5 L9.50547087,3.5 C9.8920702,3.5 10.2054709,3.81340068 10.2054709,4.2 C10.2054709,4.36375555 10.1480595,4.52232858 10.0432258,4.64812908 Z">
                                </path>
                            </svg>
                        </li>
                        <li :class="'nav-item ' + (tabIndex === 2 ? 'active' : '')" @click="selTab(2)">
                            <a class="nav-txt">TA 的喜欢</a>
                        </li>
                        <li :class="'nav-item ' + (tabIndex === 3 ? 'active' : '')" @click="selTab(3)">
                            <a class="nav-txt">TA 的合集</a>
                        </li>
                    </ul>
                </div>
                <publish-list v-if="tabIndex === 1"></publish-list>
                <collect-list v-if="tabIndex === 3"></collect-list>
            </div>
            <right></right>

        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue'
import publishList from "./publish_list.vue";
import right from "./right.vue";
import collectList from "./collect_list.vue";

const tabIndex = ref(1)
const tabIndexOfSmall = ref(1)

const selTab = (index1, index2) => {
    tabIndex.value = index1
    if (index2) {
        tabIndexOfSmall.value = index2
    }
    else {
        tabIndexOfSmall.value = 0
    }
}
</script>
<style scoped>
    .new-user-index .profile-body {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-pack: justify;
        -ms-flex-pack: justify;
        justify-content: space-between;
        width: 1200px;
        margin: 10px auto 0 auto;
    }

    .new-user-index .profile-body .body-left {
        width: 900px;
        margin-right: 20px;
    }

    .new-user-index .profile-body .body-left .banner-wrap {
        height: 160px;
    }

    .new-user-index .profile-body .body-left .card {
        padding: 4px;
        border-radius: 0 0 6px 6px;
        -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
        background-color: #fff;
    }

    a {
        cursor: pointer;
        text-decoration: none;
        color: #366cd9;
    }

    .new-user-index .profile-body .body-left .banner-wrap .banner {
        border-radius: 6px 6px 0 0;
        height: 100%;
        width: 100%;
    }

    .new-user-index .profile-body .body-left .card {
        padding: 4px;
        border-radius: 0 0 6px 6px;
        -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
        background-color: #fff;
    }

    .user-info {
        padding: 16px;
    }

    .user-info .user-info-top {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-pack: justify;
        -ms-flex-pack: justify;
        justify-content: space-between;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
    }

    .user-info .user-info-top .avatar-wrap {
        position: relative;
        width: 148px;
        height: 148px;
        overflow: hidden;
        border-radius: 50%;
        border: 4px solid #fff;
        margin-top: -104px;
    }
    .user-info .user-info-top .avatar-wrap .avatar-img {
        width: 140px;
        height: 140px;
    }

    .user-info .user-info-bottom .user-info-name {
        font-size: 22px;
        font-weight: 600;
        line-height: 1.27;
        color: #252526;
        margin-top: 16px;
    }

    .user-info .user-info-bottom .user-info-tags {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        margin-top: 10px;
    }

    .user-info .user-info-bottom .user-info-tags svg {
        margin-right: 8px;
    }

    .user-info .user-info-bottom .user-info-tags .user-info-tag {
        height: 20px;
        padding: 0 6px;
        margin-right: 8px;
        border: 1px solid #f0f0f7;
        border-radius: 4px;
        background-color: #f5f5fa;
        font-size: 12px;
        line-height: 18px;
        color: #575759;
    }

    .user-info .user-info-bottom .user-info-follow .follow-item {
        display: inline-block;
        margin-right: 32px;
        font-size: 18px;
        font-weight: 500;
        line-height: 20px;
        color: #252526;
    }

    .user-info .user-info-bottom .user-info-follow .follow-item .thin-txt {
        font-size: 16px;
        font-weight: 400;
        color: #a1a1a6;
        vertical-align: text-bottom;
    }

    .user-info .user-info-bottom .user-info-follow .follow-item {
        display: inline-block;
        margin-right: 32px;
        font-size: 18px;
        font-weight: 500;
        line-height: 20px;
        color: #252526;
    }

    .nav-tab {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        background-color: #fff;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        justify-content: space-around;
    }

    .nav-tab .nav-item.active,
    .nav-tab .nav-item:hover {
        font-weight: 500;
    }

    .nav-tab .nav-item {
        -webkit-box-flex: 1;
        -ms-flex: 1;
        flex: 1;
        height: 50px;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        font-size: 16px;
        line-height: 1.5;
    }

    .dm-popover {
        display: inline-block;
        position: relative;
    }

    .nav-tab .nav-item.active .nav-txt,
    .nav-tab .nav-item:hover .nav-txt {
        color: #fa4b8b;
    }

    .nav-tab .dm-popover-content {
        top: 36px !important;
        border-radius: 4px !important;
    }

    .dm-popover-content {
        visibility: hidden;
        display: inline-block;
        position: absolute;
        z-index: -1;
        background-color: #fff;
        border: 1px solid #e5e5e5;
        border-radius: 2px;
        -webkit-box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1);
        box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1);
        padding: 10px;
    }

    .nav-tab .dm-popover-content .dm-popover-arrow {
        z-index: -1;
    }

    .dm-popover-content .dm-popover-arrow.arrow-B {
        -webkit-transform: rotate(45deg);
        transform: rotate(45deg);
    }

    .dm-popover-content .dm-popover-arrow {
        display: block;
        background-color: #fff;
        width: 10.64px;
        height: 10.64px;
        position: absolute;
        border-radius: 1.5px;
        border-color: #e5e5e5 transparent transparent #e5e5e5;
        border-style: solid;
        border-width: 1px;
    }

    .nav-tab .filter-list .filter-item.active {
        cursor: not-allowed;
        color: #fa4b8b;
    }

    .nav-tab .filter-list .filter-item {
        cursor: pointer;
        width: 98px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        font-size: 14px;
        font-weight: 400 !important;
        color: #252526;
    }

    nav-tab .nav-item.active .spread,
    .nav-tab .nav-item:hover .spread {
        fill: #fa4b8b;
    }

    .nav-tab .nav-item .spread {
        margin-left: 4px;
        -webkit-transition: all .2s ease;
        transition: all .2s ease;
    }

    .nav-tab .nav-item .nav-txt {
        color: #252526;
    }

    .user-info .user-info-top .operations {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-pack: justify;
        -ms-flex-pack: justify;
        justify-content: space-between;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        margin-top: -24px;
    }

    .user-info .user-info-top .operations .follow-btn {
        cursor: pointer;
        width: 88px;
        height: 36px;
        padding: 7px 0;
        border: 1px solid #fa4b8b;
        border-radius: 6px;
        font-size: 14px;
        line-height: 20px;
        text-align: center;
        color: #fff;
        background-color: #fa4b8b;
    }

    button {
        outline: none;
        border-color: transparent;
    }

    .user-info .user-info-top .operations .pm-btn {
        cursor: pointer;
        width: 60px;
        height: 36px;
        padding: 7px 0;
        border-radius: 6px;
        margin: 0 12px;
        border: 1px solid #e9e9f0;
        font-size: 14px;
        line-height: 20px;
        text-align: center;
        color: #575759;
        background-color: #fff;
    }

    .user-info .user-info-top .operations .more-btn {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        cursor: pointer;
        width: 36px;
        height: 36px;
        border-radius: 6px;
        border: 1px solid #e9e9f0;
    }

    .user-info .user-info-top .operations .follow-btn:hover {
        color: #fa4b8b;
        background-color: #fff;
    }

    .user-info .user-info-top .operations .pm-btn:hover {
        color: rgba(0, 0, 0, .96);
    }

    .user-info .user-info-top .operations .dm-popover-content .dm-popover-arrow {
        z-index: -1;
    }

    .dm-popover-content .dm-popover-arrow.arrow-B {
        -webkit-transform: rotate(45deg);
        transform: rotate(45deg);
    }

    .dm-popover-content .dm-popover-arrow {
        display: block;
        background-color: #fff;
        width: 10.64px;
        height: 10.64px;
        position: absolute;
        border-radius: 1.5px;
        border-color: #e5e5e5 transparent transparent #e5e5e5;
        border-style: solid;
        border-width: 1px;
    }

    .user-info .user-info-top .operations .more-opts {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
    }

    .user-info .user-info-top .operations .more-opts .opt-item:hover {
        background-color: #f5f5fa;
    }

    .user-info .user-info-top .operations .more-opts .opt-item {
        width: 120px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        font-size: 16px;
        color: #252526;
    }

    .clickable {
        cursor: pointer;
    }

    .user-info .user-info-bottom .user-info-self-intro {
        max-height: 110px;
        margin: 20px auto;
        overflow: hidden;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.57;
        letter-spacing: normal;
        color: #252526;
        white-space: pre-wrap;
    }

    .dm-popover-content.dm-popover-show {
        visibility: visible;
        z-index: 101;
    }

    .dm-popover-content {
        transition: all 0.5s ease-in-out;
    }

    .dm-popover:hover .dm-popover-content {
        visibility: visible;
        z-index: 101;
    }

</style>